
#include "../../include/jni/com_lemon_jvm_jdk_Threads.h"
#include "../../include/memory/memory_pool.h"

MemoryPool* g_memoryPool;

MemoryChunk* g_newGeneration;
MemoryChunk* g_oldGeneration;

/*
 * Class:     com_lemon_jvm_jdk_Threads
 * Method:    createVM
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_com_lemon_jvm_jdk_Threads_createVM
(JNIEnv * env, jclass jclazz){
    // 做很多事情

    // 接入内存池
    g_memoryPool = new MemoryPool;

    // 从操作系统拿内存
    g_newGeneration = g_memoryPool->new_chunk(80);
    g_oldGeneration = g_memoryPool->new_chunk(160);
}

